<?php
 /**
 * Author: Jason ZHENG
 * Date: 2018-05-17
 * Class: ReturnData 用于返回统一数据格式
 * 
 * 
 */
namespace app\index\service;

class ReturnData
{
    static public function error($code, $msg="", $data=[])
    {
        return [
            "code"  => $code,
            "msg"   => "错误:".$msg,
            "data"  => $data
        ];
    }


    static public function ok($data=[],$msg='OK')
    {
        return [
            "code"  => 666,
            "msg"   => $msg,
            "data"  => $data
        ];
    }

}
